home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
151-175
/
scopedisk165
/
filefind2
/
filefind.doc
< prev
next >
Wrap
Text File
|
1995-03-19
|
17KB
|
361 lines
FileFind Amiga!
Version 2.0
Created by Ray Lambert
Copyright 1990 Ray Lambert
FileFind is a utility which will search for files on AmigaDOS filing
devices using filename wildcards. The MS-DOS wildcards "*" and "?" can be
used as well as the AmigaDOS wildcard "#" (in a slightly limited capacity),
and a special character, "|", which allows multiple individual wildcard
patterns to be used as one. Specification of a drive/device is optional and
if not supplied the currently logged drive is used. An optional directory
specifier may also be used which limits the search to the specified directory
and all sub-directory levels under it. Multiple arguments may be supplied to
search on more than one drive for a particular file, or to search for
multiple files on multiple devices. Ctrl-C may be used to immediately
terminate the search and return your CLI prompt to you. Version 2.0 is pure
and as such can be made resident. It also actively supports Workbench,
output redirection and background execution, as well as combinations of
these. Various options allow the user to control the depth of sub-directory
searches and also to exclude certain sub-directories from the search.
Usage Template
--------------
[Run] FileFind [>output] [options] [DRIVE:][PATH/]PATTERN [...]
where....
[Run] is used to execute FileFind in the background (see Running
FileFind In The Background, below)
[>output] is used to to redirect FileFind's output to a disk file
or another device such as a printer (see Redirecting FileFind's
Output, below)
[options] (see Options, below, for detailed descriptions)
+/-R progress Report ON/OFF (default = ON)
+/-C Case sensitivity ON/OFF (default = OFF)
+/-L Log match directory ON/OFF (default = OFF)
+/-P Path search ON/OFF (default = OFF)
=D# set Depth limit (0 = infinite/default)
=X$ set eXclude path (null = no exclude/default)
=M# set search Mode...
(0 = non-stop (default); 1 = find one; 2 = query)
[DRIVE:] is an optional drive/filing-system-device to search on
[PATH/] is an optional path to begin searching in
PATTERN is the filename to search for (see Pattern Matching, below)
[...] indicates that multiple arguments may be specified optionally
The Command Line
----------------
FileFind scans its command line sequentially, left to right. It begins
searching as soon as it finds a search pattern. When a search is finished
FileFind resumes scanning its command line from where it left off. This
allows multiple searches to be performed in one invocation of FileFind, with
different options used for each search. Although '[options]' and
'[DRIVE:][PATH/]PATTERN' are shown in a specific order in the above template,
in reality options and file patterns can be intermixed freely, as
appropriate, on the command line. Any option or file pattern which requires
embedded space characters MUST be completely enclosed in double quotes.
Running FileFind In The Background
----------------------------------
As with most programs, FileFind may be executed in the background using
the AmigaDOS RUN command. Unlike many programs however, FileFind knows when
you do this and will take extra steps to cooperate. Mainly, FileFind will
open a console window and perform all of its operations in that window rather
than the CLI or Shell window that it was executed from. This allows the user
to have FileFind doing its thing while the user's CLI remains free to do
other things. This may be desirable is some cases -- especially when
searching on a large hard disk. As fast as FileFind is (and it _is_ fast!)
it can still take awhile to search a large volume. Before FileFind closes
its console window, it will wait for the user to press RETURN, thereby
allowing the user time to read its final messages.
Redirecting FileFind's Output
-----------------------------
As with most programs, FileFind's output may be redirected to a device
other than the console that it was executed from (normally a disk file or the
printer). Unlike many programs however, FileFind knows when you do this and
will take extra steps to cooperate -- FileFind will strip all ANSI control
sequences from its output.
Output redirection is a normal function of AmigaDOS. It is accomplished
by placing the name of the output device (or filename) directly following the
program name and seperated by at least one space character. The output
device name must be prefixed with a right angle bracket character.
Optionally, two right angle brackets may be used to indicate an append
operation (if the disk file already exists, the new data will be appended to
the end of it, as opposed to erasing the file's former contents -- however if
the file does not exist AmigaDOS will issue an error). If FileFind's output
is redirected to a non-interactive device (such as a disk file or the printer
-- this is virtually always the case) then 'query mode' (see the Options
section, below) is implicitly disabled. Also, progress reporting is also
implicitly disabled by output redirection.
Background Execution And Output Redirection At The Same Time
------------------------------------------------------------
If FileFind is executed in the background _and_ its output is redirected
at the same time it will operate slightly differently. In this case, the
output redirection will take place as descibed in the previous section, and
FileFind will still open a console window, however it will not use the
console window in the same manner as described in the section entitled
"Running FileFind In The Background". Rather, FileFind will open a small
window and simply display its title in that window. The user knows that the
search operation is complete when the title window goes away.
Running FileFind From Workbench
-------------------------------
FileFind can be run from Workbench by simply double-clicking on its icon.
When run from Workbench, FileFind opens a console window much as it does when
it is run in the background from the CLI or Shell. Except that it will
prompt the user to enter a command. The syntax for a Workbench command line
is the same as that for a CLI command line (as described above in the
template) except that the RUN command is not allowed and nor is the program
name itself (FileFind). Output redirection _IS_ supported on FileFind's
Workbench command line, including append mode using double right angle
brackets! If output redirection is used on the Workbench command line, the
redirection command MUST appear first and it is suggested that a full path
name be used as Workbench's idea of a current directory is a bit fuzzy to say
the least -- if you do not use a full path name you may end-up using FileFind
again just to find your redirection file [grin]!
Options
-------
FileFind's command line options must be prefixed with either a plus (+)
sign, a minus (-) sign, or an equals (=) sign. Plus and minus signs are used
on options which can be toggled ON and OFF (plus means ON and minus means
OFF), while an equals sign is used on options which define a specific value.
After the prefix is a letter that indicates which option is being defined
(the case of the letter is not significant). Following options that are
prefixed with an equals sign is an alpha-numeric value with no intervening
spaces. A detailed desciption of each option follows:
Progress Report (+R or -R -- ON by default)
When this option is on, FileFind will display the full name of
every sub-directory it searches in. If ON, this option will slow
FileFind down a bit, so for maximum search speed it is neccessary to
turn this option OFF. When a sub-directory name is displayed it
overwrites any previous progress report. If a sub-directory name is
too long to print in the console window without causing a scroll to
occur, FileFind will truncate the name on the left, allowing the actual
sub-directory name to be always visible. When a sub-directory name
gets truncated, a double arrow character («) will be prefixed to the
truncated name to indicate that the name was truncated.
Case Sensitivity (+C or -C -- OFF by default)
When ON, this option will force all wildcard matches
(including sub-directory excludes -- see below) to be case-sensitive.
Log Last Match Directory (+L or -L -- OFF by default)
When ON, this option will cause FildFind to change the current
working directory to the directory in which the last match was found.
Note that this option is explicitly disabled when FileFind is run from
Workbench or run in the background.
Path Search (+P or -P -- OFF by default)
When this option is on, FileFind will search all the
directories in your path (see the AmigaDOS PATH command), rather than a
branch of the directory tree. FileFind will only search in mounted
path locations, and will always look in the current directory and the
'C:' directory. FileFind will not look in any sub-directories which
branch off directories defined in your path, therefore, the
'Sub-directory Search Depth Limit' and the 'Sub-directory Exclude Path'
options (see below) have no effect when this option is ON. When run
from Workbench, FileFind will normally search only the current
directory and the 'C:' directory, because programs do not normally
inherit a path definition from Workbench (note that this may change
under Workbench 2.0).
Set Sub-directory Search Depth Limit (=D# -- 0 (infinite) by default)
This option allows the user to place a limit on how many
sub-directories deep FileFind will search into the directory tree.
Replace the '#' character with a numeric (decimal) value to define a
limit or to remove a previously defined limit. A value of zero
indicates infinite depth. Any other value will place a limit into
effect. The first directory that FileFind looks in is considered the
'root' directory, and sub-directories of that 'root' are considered one
level deep. FileFind will not search at or deeper than the defined
limit. Therefore, a level of one will cause only the 'root' directory
to be searched in.
Set Sub-directory Exclude Path (=X$ -- none by default)
This option allows the user to instruct FileFind to ignore
specific directories that it encounters during its search. Replace the
'$' character with a pattern string which matches the directory(s)
which should be excluded. If nothing appears after the 'X' character
any previously defined exclude path will be cleared, leaving no exclude
path active. Each exclude path definition on a single command line
replaces all previous definitions -- multiple definitions are not
additive. When FileFind encounters a sub-directory during its search,
normally it enters that sub-directory to perform a search in it.
However if that sub-directory name matches the active exclude path,
FileFind will simply ignore it and continue searching the directory it
is in. Note that when FileFind excludes a sub-directory in this manner
it also effectively excludes all sub-directories which are lower on the
same branch. Note also that FileFind performs a compare only on the
sub-directory name itself -- it does not use the full path name of the
sub-directory. See the section on patterns (below) for a
desciption of what wildcards can be used in an exclude path.
Set Search Mode (=M# -- 0 (non-stop) by default)
This option allows the user to control FileFind's action upon
finding a matching file. Three modes are currently offered. One of
these three modes is selected by replacing the '#' character with one
of three digits representing the three modes: '0', '1' or '2'. Mode
'0', also called 'non-stop' mode, is the default. In this mode
FileFind continues searching after finding a match until all places to
search in have been exhausted. When in mode '1' (also called 'find
one' mode) FileFind will stop searching after finding the first match.
In mode '2' (also called 'query mode') FileFind will pause and prompt
the user for what to do next. FileFind will ask 'Continue searching?',
and the user must give one of the following answers: 'Yes', 'No' or
'Abort' (note that the user need only type the first letter of each
response). 'Yes' will cause FileFind to resume searching -- it will
pause again with the next match it finds. 'No' will cause FileFind to
stop the search right away. 'Abort' will do the same as 'No' except
that 'No' will still allow the directory to be logged if the +L option
is active while 'Abort' will not.
Note that if multiple search patterns where given on the
command line, and FileFind has not yet reached the last one,
FileFind will go on to the next search pattern when it stops searching
on the surrent one, rather than simply exiting -- this is true for
both the 'No' and 'Abort' responses in 'query mode', and it is also
for 'find one mode'.
Note that this mode is implicitly disabled if FileFind's output
has been redirected to a non-interactive device (such as a disk file
or the printer).
Pattern Matching
----------------
FileFind uses pattern matching both to locate files and to find
sub-directories to exclude in conjunction with its Sub-directory
Exclude option. 'Pattern Strings' are used to perform matching.
Pattern strings consist of literal characters as well as 'wildcards'
which match any character(s). FileFind recognizes the following
wildcard characters:
? - matches one of any character.
#x - matches one or more occurances of "x", which can be
any valid character.
* - matches any number of any characters.
#? - a special case of "#x" and "?" which works the same as "*".
| - indicates the beginning of a new pattern string -- this
wildcard DOES NOT work in the same manner as it does in
AmigaDOS pattern matching -- rather, it is used to
concatenate multiple pattern strings to be matched in a
parallel fashion -- think of it as meaning 'or'...
match 'this' _or_ 'this' _or_ 'this', etc.
Some Usage examples:
--------------------
Search for all C source files on "DH0:"...
FileFind DH0:*.c
Search for all files with the word "disk" in them in "c:"...
FileFind c:*disk*
Search in the CLI path for all files with the word "disk" in them...
FileFind +p c:*disk*
Search for all Workbench icon files (.info) on "DH0:" and "DH1:".
Exclude all "fonts" directories on DH0: but not on DH1:...
FileFind =x*fonts* dh0:*.info =x dh1:*.info
Search for all ".c" and ".h" files on DH0: and SRC:
Exclude all "fonts" directories and use query mode
FileFind =x*fonts* =m2 dh0:*.c|*.h src:*.c|*.h
Search for all ".info" files on DF0: and send the output to the printer
Also run FileFind in the background to free-up the CLI
Run FileFind >prt: df0:*.info
Legalities
----------
FileFind is FreeWare. This means that I retain all rights to the program
but give permission for it be distributed freely, so long so no charge is
made for the program itself. This document and notice should accompany any
distribution of the program. FileFind may not be sold commercially without
permission from the author.
If you have questions, complaints, suggestions, propositions, etc., you
may contact me at the following places:
People Link: Analog*Kid (call often)
BIX: AnalogKid (call sparsely)
Home: Ray Lambert
PO Box 1253
Westport, Massachusetts 02790
Phone: (508) 677-9217